<?php include_partial('back/show', array('uri' => '@localized_homepage')); ?>
<h1 class="title">Galerie photos</h1>
<ul class="list-photo">
<?php
foreach($albumsPhotos as $album){
    $lastPhoto = null;
    foreach($lastPhotosByAlbum as $lastPhotoByAlbum){
        if($lastPhotoByAlbum['category_id'] == $album['id']){
            $imagesAttributes = Utils::getImageSize($lastPhotoByAlbum['sfAsset'][ 'Folder' ][ 'relative_path' ], $lastPhotoByAlbum['sfAsset'], 173, 114);
//            $lastPhoto = '<img title="' . $lastPhotoByAlbum['sfAsset'][ 'slug' ] . '" alt="' . $lastPhotoByAlbum['sfAsset'][ 'slug' ] . '"
//                               src="' . $imagesAttributes['small']['url'] . '" width="' . $imagesAttributes['small']['width'] . '" height="' . $imagesAttributes['small']['height'] . '" />';
            $lastPhoto = '<img title="' . $lastPhotoByAlbum['sfAsset'][ 'slug' ] . '" alt="' . $lastPhotoByAlbum['sfAsset'][ 'slug' ] . '"
                               src="' . $imagesAttributes['small']['url'] . '" width="173" height="124" />';
        }
    }
    if(!empty($lastPhoto)){ ?>
        <li>
            <a href="<?php echo url_for('@gallery_photos_show_detail?title_slug=' . $album[ 'slug' ]) ?>">
                <?php echo $lastPhoto ?>
                <h3><?php echo $album[ 'title' ] ?></h3>
            </a>
        </li>
<?php
    }
}
?>
</ul>
<div class="push_float_left"></div>